﻿<div class="text-center">
    <MButton Color="deep-purple accent-4"
             Class="white--text"
             OnClick="Toggle">
        Launch Application
        <MIcon Right>
            mdi-open-in-new
        </MIcon>
    </MButton>

    <MOverlay Value="overlay">
        <MProgressCircular indeterminate
                           Size="64"></MProgressCircular>
    </MOverlay>
</div>

@code {
    bool overlay = false;

    void Toggle(MouseEventArgs args)
    {
        overlay = true;

        Task.Run(async () =>
        {
            await Task.Delay(3000);
            overlay = false;

            await InvokeAsync(StateHasChanged);
        });
    }
}